#pragma once

#include <QtUiPlugin/QDesignerCustomWidgetInterface>
#include "../SwitchButton.h"

class SwitchButtonPlugin : public QObject, public QDesignerCustomWidgetInterface
{
	Q_OBJECT
	//Q_PLUGIN_METADATA(IID "org.sumscope.com.widets.SwitchButtonInterface")
	Q_INTERFACES(QDesignerCustomWidgetInterface)

public:
	explicit SwitchButtonPlugin(QObject* parent = nullptr) : QObject(parent) {}

    virtual QString name() const override { return QStringLiteral("SwitchButton"); }
    virtual QString group() const override { return QStringLiteral("Sumscope"); }
    virtual QString toolTip() const override { return QStringLiteral("Indicate Switch Status"); }
    virtual QString whatsThis() const override { return QStringLiteral("Indicate Switch Status"); }
    virtual QString includeFile() const override { return QStringLiteral("SwitchButton.h"); }
    virtual QIcon icon() const override { return QIcon(); }

    virtual bool isContainer() const override { return false; }

    virtual QWidget* createWidget(QWidget* parent) override { return new SwitchButton(true, parent); }

    virtual bool isInitialized() const override { return m_bInitialized; }
    virtual void initialize(QDesignerFormEditorInterface* core) override;

private:
    bool    m_bInitialized = false;
};
